package org.sipsl.gisystems.gentest.rte.commands;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;

import org.sipsl.gisystems.gentest.rte.util.GenericUtil;
import org.sipsl.gisystems.gentest.rte.util.Params;

public class UnSetBundle extends RteCommand {
	
	//MOD:SUBID,447300030203:ELEMENT,MAS01:IMOM_CMD,RMV_BUNDLE:RB_PROMO_COSP,FP_AS_AMI;
	private String s;
	
	public UnSetBundle(Params p, String s) {
		super(p);
		this.s = s ;
		// TODO Auto-generated constructor stub
	}
	
	public String getScript(){
		return "MOD:SUBID,"+p.getMSISDN()+":ELEMENT,MAS01:IMOM_CMD,RMV_BUNDLE:RB_PROMO_COSP,"+s+";";
	}

	public void dumpScript(String title, int i){
		try  
		{
			String prefix = GenericUtil.MakePrefix(i);
		    FileWriter fstream = new FileWriter(title+"/"+prefix+":unsubbundle-New.hpp"); //true tells to append data.
		    BufferedWriter out = new BufferedWriter(fstream);
		    GenericUtil.LOG(title+"/"+prefix+":unsubbundle-New.hpp");
		    GenericUtil.LOG("MOD:SUBID,"+p.getMSISDN()+":ELEMENT,MAS01:IMOM_CMD,RMV_BUNDLE:RB_PROMO_COSP,"+s+";");
		    out.write("MOD:SUBID,"+p.getMSISDN()+":ELEMENT,MAS01:IMOM_CMD,RMV_BUNDLE:RB_PROMO_COSP,"+s+";\n");
		    out.flush();
		    out.close();
		    testDescription = "";

		}
		catch (Exception e)
		{
		    System.err.println("Error: " + e.getMessage());
		}
		
	}

}
